
package com.cuit.xsc.weishare.activity;



import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.cuit.xsc.weishare.R;

public class MoreAct extends Activity implements OnClickListener
{
	private TextView titleTv;
	private LinearLayout moreSetting;
	private LinearLayout moreVersion;
	private LinearLayout moreFeedback;
	private LinearLayout moreAbout;



	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.more);
		titleTv = (TextView) findViewById(R.id.txt_wb_title);
		titleTv.setText("更多");
		
		moreSetting = (LinearLayout) findViewById(R.id.more_setting);
		moreVersion = (LinearLayout) findViewById(R.id.more_version);
		moreFeedback = (LinearLayout) findViewById(R.id.more_feedback);
		moreAbout = (LinearLayout) findViewById(R.id.more_about);
		
		moreSetting.setOnClickListener(this);
		moreVersion.setOnClickListener(this);
		moreFeedback.setOnClickListener(this);
		moreAbout.setOnClickListener(this);
		
		
		
		System.out.println("more......");
	}



	@Override
	public void onClick(View v)
	{
		switch (v.getId())
		{
		case R.id.more_setting:

			break;
		case R.id.more_version:
			HelpDialog versionDialog = new HelpDialog(this, R.string.help_version_text);
			versionDialog.show();

			break;
		case R.id.more_feedback:
			HelpDialog feedbackDialog = new HelpDialog(this, R.string.help_feedback_text);
			feedbackDialog.show();
			break;
		case R.id.more_about:
			Intent intent = new Intent(this, AboutAct.class);
			startActivity(intent);
			break;
		}
		
	}
	
	public class HelpDialog extends AlertDialog
	{
		public HelpDialog(Context context, int contextId)
		{
			super(context);
			final View view = getLayoutInflater().inflate(R.layout.help_dialog, null);
			TextView textView = (TextView) view.findViewById(R.id.dialog_text);
			textView.setText(context.getString(contextId));
			setButton(context.getText(R.string.close), (OnClickListener) null);
			setIcon(R.drawable.icon);
			setTitle("WeiShare version:" + context.getString(R.string.version));
			setView(view);
		}
	}


	
	
}
